import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { PassportModule } from '@nestjs/passport';
import { defaultConfig } from '@game/config/config';
import { UserController } from './user.controller';
import { UserService } from './user.service';
import { EntityProviders } from '@common/database/entity.provider';
import { DatabaseModule } from '@common/database/database.module';

@Module({
  imports: [
    DatabaseModule,
    PassportModule,
    JwtModule.register({
      secret: defaultConfig.webJwtConfig.secret,
      signOptions: { expiresIn: defaultConfig.webJwtConfig.expiresIn },
    }),
  ],
  controllers: [UserController],

  providers: [...EntityProviders, UserService],
  exports: [UserService],
})
export class UserModule {}
